
//
//  JNChannelModel.m
//  JNNetEestNews
//
//  Created by Jyougen on 2017/3/10.
//  Copyright © 2017年 Jyougen. All rights reserved.
//

#import "JNChannelModel.h"
#import <YYModel.h>

@implementation JNChannelModel

+ (NSArray *)getModelArr{

    NSString * jsonPath = [[NSBundle mainBundle] pathForResource:@"topic_news.json" ofType:nil];
    
    NSData * data = [NSData dataWithContentsOfFile:jsonPath];
    
    NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
    
    NSArray * arr = [dic objectForKey:@"tList"];

    NSArray * channelArr = [NSArray yy_modelArrayWithClass:[JNChannelModel class] json:arr];
    
   channelArr = [channelArr sortedArrayUsingComparator:^NSComparisonResult(JNChannelModel * obj1, JNChannelModel * obj2) {
       
        
        return [obj1.tid compare:obj2.tid];
    }];
    
    return channelArr;
}

- (NSString *)description{

    NSString * str = [NSString stringWithFormat:@"%@-%@",_tid,_tname];
    
    return str;
}

@end
